<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="flex-box">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img
        class="outline-parent-bg"
        :src="publicUrls + 'free/style8/Level2outlineStyle2Bg.webp'"
        alt=""
      />
      <div class="outline border-hover-style">
        <div class="outline-content" v-if="props.info.value || props.info.subTitle || props.info.remarks">
          <div class="content-tiitle">
            <div class="text-box" v-if="props.info.text?.length > 10" v-html="textType(props.info.text)"></div>
            <div class="text-box" v-else>{{ props.info.text }}</div>
          </div>
          <div class="outline-subTitle" v-if="props.info.subTitle">
            <p>
              <img :src="publicUrls + 'free/style8/Level2outlineSubtitleBg.webp'" alt="" />
              {{ props.info.subTitle }}
              <img :src="publicUrls + 'free/style8/Level2outlineSubtitleBg.webp'" alt="" />
            </p>
          </div>
          <TextMax
            v-if="props.domShow"
            :data="props.info.remarks"
            :infoData="props.info"
            :title="props.info.text"
            :row="props.info.value ? 5 : 9"
            :class="!props.info.subTitle && 'Textmax-Margin'"
          ></TextMax>
          <div class="outline-cover" v-if="props.info.value">
            <div class="outline-cover2">
              <img
                @click="ImgVisible = true"
                :src="urls + props.info.value + '?imageView2/3/w/600/h/600/format/webp'"
                alt=""
              />
            </div>
          </div>
        </div>
        <div class="outline-content2" v-else>
          <div class="content-tiitle2" v-html="textType(props.info.text)"></div>
        </div>
      </div>
    </div>
    <img class="shadow" :src="publicUrls + 'free/style8/firstLevelOutline2Shadow.png?imageView2/3/format/webp'" alt="" />
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free8Style2',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style8.vue';
import textMode from '../../../textMode/textMode.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-right: 280px;
}
.flex-box {
  width: 490px;
  height: 774px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 19;
}
.shadow {
  width: 652px;
  height: 188px;
  position: absolute;
  bottom: -30px;
  left: -20px;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.outline {
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding-right: 10px;
}
.outline-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 264px;
  height: 100%;
  padding-top: 110px;
  padding-bottom: 60px;
}
.content-tiitle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 264px;
  height: 64px;
  padding-bottom: 23px;
  border-bottom: 1px solid #fff;
  margin-bottom: 16px;
  .text-box {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    font-family: SourceHanSerifCN-Bold;
    font-size: 24px;
    line-height: 32px;
    text-align: center;
    color: #fff;
    ::v-deep p {
      font-family: SourceHanSerifCN-Bold;
      font-size: 24px;
      line-height: 32px;
      text-align: center;
      color: #fff;
    }
  }
}
.outline-content2 {
  width: 264px;
}
.content-tiitle2 {
  width: 100%;
  padding: 24px 0;
  border-top: 1px solid #fff;
  border-bottom: 1px solid #fff;
  ::v-deep p {
    font-family: SourceHanSerifCN-Bold;
    font-size: 24px;
    line-height: 32px;
    text-align: center;
    color: #fff;
  }
}
.outline-subTitle {
  width: 100%;
  min-height: 72px;
  margin-bottom: 24px;
  display: flex;
  align-items: start;
  justify-content: center;
  ::v-deep p {
    width: 100%;
    text-align: center;
    font-family: SourceHanSerifCN;
    font-size: 18px;
    line-height: 24px;
    color: rgba(255, 255, 255, 0.5);
    position: relative;
    padding: 0 28px;
  }
  img {
    width: 16px;
    height: 16px;
    position: absolute;
    top: 50%;
    animation: imgRotate 4s linear infinite;
    &:first-child {
      left: 0;
    }
    &:last-child {
      right: 0;
    }
  }
}
@keyframes imgRotate {
  0% {
    transform: translate(0, -50%) rotate(0deg);
  }
  100% {
    transform: translate(0, -50%) rotate(360deg);
  }
}
.Textmax-Margin {
  margin-top: 32px;
  margin-bottom: 48px !important;
}
.outlineHeight {
  width: 340px !important;
  height: 340px !important;
  margin-top: 20px;
}
.outline-cover {
  width: 240px;
  height: 240px;
  padding: 22px;
  flex-shrink: 0;
  position: relative;
  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url(https://static.jiyi.show/free/style8/Level2outlineRound2.png) no-repeat center/100% 100%;
    z-index: -1;
    animation: coverRotate 10s linear infinite;
  }
  .outline-cover2 {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 50%;
    &:hover img {
      transform: scale(1.2);
    }
    img {
      width: 100%;
      height: 100%;
      border-radius: 50%;
      object-fit: cover;
      transition: all 0.3s ease;
    }
  }
}

@keyframes coverRotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.Showroom-parent {
  position: absolute;
  top: 6px;
  right: 41%;
  transform: translate(-41%, 6px);
  z-index: 21;
}
::v-deep .textMore-box {
  margin-bottom: 20px;
}
::v-deep .van-text-ellipsis {
  font-family: PingFangSC !important;
  font-size: 16px !important;
  color: #fff !important;
  line-height: 32px !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: rgba(161, 199, 180, 1) !important;
  font-weight: 400 !important;
  text-decoration-line: underline;
}
</style>